<template>
  <div id="bar">
    <!--搜索、筛选-->
    <el-form
      :inline="true"
      class="demo-form-inline"
    >
      <el-form-item>
        <el-input
          v-model="filter_query.search"
          placeholder="搜索"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          @click="search"
        >
          查询
        </el-button>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          @click="add"
        >
          添加
        </el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'ApiBar',
  data: function() {
    return {
      filter_query: {
        search: undefined
      }
    }
  },
  methods: {
    search: function() {
      this.$emit('query', this.filter_query.search ? this.filter_query.search : undefined)
    },
    add() {
      this.$emit('add_collection')
    }
  }
}
</script>
